/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
 *
 * This application is open source and may be redistributed and/or modified   
 * freely and without restriction, both in commericial and non commericial applications,
 * as long as this copyright notice is maintained.
 * 
 * This application is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

#include "viewer.h"
#include "node.h"
#include "morph.h"
//#include <osgDB/WriteFile>


int main2()
{
  Node n;
  bool res = n.Load("borgia2.osg");
  //bool res = n.Load("cow.osg");
  //bool res = n.Load("C:/Documents and Settings/Aga/My Documents/3dsmax/export/MyTeapot.osg");
  if(!res) return 1;  
  
  n.SetPosition( Vec(1,1,1));
  n.SetOpacity(0.5);
  
  //osgDB::writeNodeFile( *n.Get(), "c:\\temp\\test.osg" );

  Viewer v;
  v.SetRoot(&n);
  v.Run();
}

int main()
{
  Morph m = Morph();
  m.Load("Teapot.osg");
  m.AddTarget("Teapot01.osg");
  m.AddTarget("Teapot02.osg");

  m.SetTargetWeights( Vec( -1 ,-1, 0,0)  );

  Viewer v;
  v.SetRoot(&m);    
  for( int i=-200; i<200; i+=5)
  {
    m.SetTargetWeights( Vec( i/100.0 ,i/100.0, 0,0)  );
    v.Frame();
  }
  v.Run();
}
